package com.newasia.user.dto;

import com.newasia.commons.result.AbstractRequest;
import com.newasia.commons.result.AbstractResponse;
import com.newasia.commons.tool.exception.ValidateException;
import com.newasia.user.constants.SysRetCodeConstants;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * 腾讯课堂搜索【咕泡学院】
 * 官网：www.gupaoedu.com
 * 风骚的Mic 老师
 * create-date: 2019/7/31-19:23
 */
@Data
public class UpdateAddressRequest extends AbstractRequest {

    private Long addressId;

    private Long userId;

    private String userName;

    private String tel;

    private String streetName;

    private Boolean isDefault;

    private Integer provinceId;

    private Integer cityId;

    private Integer districtId;

    @Override
    public void requestCheck() {
        if(addressId==null|| StringUtils.isBlank(streetName)||StringUtils.isBlank(tel)||
                StringUtils.isBlank(userName)||provinceId==null||cityId==null||districtId==null){
            throw new ValidateException(
                    SysRetCodeConstants.REQUEST_CHECK_FAILURE.getCode(),
                    SysRetCodeConstants.REQUEST_CHECK_FAILURE.getMessage());
        }
    }
}
